﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using SubSonic;
using CXDB;
using Coolite.Ext;
using Coolite.Ext.Web;
public partial class Search_Scores_view : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Query q = new Query(CxApply.Schema);
        q.AddWhere("id", Request["id"]);
        q.AddWhere("uid",Cookies.getCookies("cuid"));
        q.SetSelectList("bossnod,bosstime,guid");
        if (q.GetRecordCount() == 0)
        {
            Err.Warning("错误，没有找到这条记录！",MessageBox.Icon.ERROR);
            return;
        }
        IDataReader dr = q.ExecuteReader();
        if (dr.Read())
        {
            if (dr["bossnod"].ToString() != "1")
            {
                Err.Warning("请等待领导审核批准！",MessageBox.Icon.WARNING);
                return;
            }
            if (DateTime.Parse(dr["bosstime"].ToString()).AddDays(15) <= DateTime.Now)
            {
                Err.Warning("您的申请已经过期，请重新申请！",MessageBox.Icon.WARNING);
                return;
            }
            Query t = new Query(CxChengxin.Schema);
            t.SetSelectList("scores,chengxinid");
            t.ORDER_BY("chengxinid asc");            
            t.AddWhere("guid",SubSonic.Comparison.Equals,dr["guid"].ToString());
             
            IDataReader tdr = t.ExecuteReader();
            while (tdr.Read())
            {
                string chengxinid = tdr[1].ToString();
                string scores = tdr[0].ToString();
                switch (chengxinid)
                { 
                    case "1":
                        Label1.Text = scores;
                        break;
                    case "2":
                        Label2.Text = scores;
                        break;
                    case "3":
                        Label3.Text = scores;
                        break;
                    case "4":
                        Label4.Text = scores;
                        break;
                    case "5":
                        Label5.Text = scores;
                        break;
                    case "6":
                        Label6.Text = scores;
                        break;
                    case "7":
                        Label7.Text = scores;
                        break;
                    case "8":
                        Label8.Text = scores;
                        break;
                    case "9":
                        Label9.Text = scores;
                        break;
                    case "10":
                        Label10.Text = scores;
                        break;
                    case "11":
                        Label11.Text = scores;
                        break;
                    case "12":
                        Label12.Text = scores;
                        break;
                    case "13":
                        Label13.Text = scores;
                        break;
                    case "14":
                        Label14.Text = scores;
                        break;
                    case "15":
                        Label15.Text = scores;
                        break;
                    case "16":
                        Label16.Text = scores;
                        break;
                    case "17":
                        Label17.Text = scores;
                        break;
                    default: break;
                        
                }
            }
        }

    }
}
